#pragma once

class TextureUI;

class TexSelUI
{
	Dialog* m_dialog;
	void LoadButtonProc(UIButton<TexSelUI>*);
	void AddFavButtonProc(UIButton<TexSelUI>*);
	void TextureQuadClick(TextureQuad<TexSelUI>*);
	std::deque<std::string> m_lastZones;
	EditBox* m_zoneName;
	RadioButton<TexSelUI>* m_pZone;
	RadioButton<TexSelUI>* m_pADT;
	RadioButton<TexSelUI>* m_pChunk;
	RadioButton<TexSelUI>* m_pLast;
	TextureUI* m_pTexUI;
	TilesetUI* m_pTileset;
	std::vector<TextureQuad<TexSelUI>*> m_quads;
	void ListButtonProc(UIButton<TexSelUI>* pButton);
	void TabPageChangeProc(RadioButton<TexSelUI>* pButton, bool checked);
	ADTChunk* m_lastChunk;
	ADTModel* m_lastModel;

	void UpdateLastTex();
	
public:
	TexSelUI(TextureUI* pTexUI);
	void Toggle()
	{ 
		m_dialog->m_visible = !m_dialog->m_visible;
		if(!m_dialog->m_visible)
			m_pTileset->Hide();
	}
	void Show()
	{
		m_dialog->m_visible = true;
	}
	void SetZone(std::string szZone);
	void Update();
};